import request from '@/utils/request'

// 房间分类：获取房间基本信息
export const roomMessageService = () => {
  return request.get('/room/roomMessage')
}

// 房间分类：上传本地图片，获取url
export const roomHeadFileService = (data) => {
  console.log(data) //上传单张照片
  return request.post('/room/upload', data)
}
export const roomHeadFileServices = (data) => {
  console.log(data) //上传多张照片
  return request.post('/room/uploads', data)
}

// 房间分类：新增一条数据
export const insertRoomDataService = (data) => {
  return request.post('/room/insertRoomData', data)
}

// 房间分类：修改房间信息
export const updataRoomDataService = (data) => {
  return request.post('/room/updataRoomData', data)
}

// 房间分类：删除房间信息
export const delRoomService = (room_id) => {
  return request.get(`/room/delRoomData/${room_id}`)
}

// 房间管理：获取房间轮播图片
export const getRoomImagesService = (room_id) => {
  return request.get(`/room/getRoomImages/${room_id}`)
}
// 房间管理：获取房间详情图片
export const getRoomMessageImgService = (room_id) => {
  return request.get(`/room/getRoomMessageImg/${room_id}`)
}

// 房间管理：修改房间信息
export const updataRoomDataService2 = (data) => {
  return request.post('/room/updataRoomData2', data)
}
//房间管理：插入RoomImages表一条数据
export const insertRoomImagesService = ({ room_id, image_url }) => {
  return request.post('/room/insertRoomImages', { room_id, image_url })
}
//房间管理：插入RoomMessageImg表一条数据
export const insertRoomMessageImgService = ({ room_id, image_url }) => {
  return request.post('/room/insertRoomMessageImg', { room_id, image_url })
}

//房间管理：删除三步
export const delRoomData2Service = (room_id) => {
  return request.get(`/room/delRoomData2/${room_id}`)
}
export const delRoomImagesService = (room_id) => {
  return request.get(`/room/delRoomImages/${room_id}`)
}
export const delRoomMessageImgService = (room_id) => {
  return request.get(`/room/delRoomMessageImg/${room_id}`)
}
